package com.ruoyi.smart.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smart.mapper.SmartEquipmentStateMapper;
import com.ruoyi.smart.domain.SmartEquipmentState;
import com.ruoyi.smart.service.ISmartEquipmentStateService;

/**
 * 设备状态Service业务层处理
 * 
 * @author minwei
 * @date 2022-04-07
 */
@Service
public class SmartEquipmentStateServiceImpl implements ISmartEquipmentStateService 
{
    @Autowired
    private SmartEquipmentStateMapper smartEquipmentStateMapper;

    /**
     * 查询设备状态
     * 
     * @param id 设备状态主键
     * @return 设备状态
     */
    @Override
    public SmartEquipmentState selectSmartEquipmentStateById(Long id)
    {
        return smartEquipmentStateMapper.selectSmartEquipmentStateById(id);
    }

    /**
     * 查询设备状态列表
     * 
     * @param smartEquipmentState 设备状态
     * @return 设备状态
     */
    @Override
    public List<SmartEquipmentState> selectSmartEquipmentStateList(SmartEquipmentState smartEquipmentState)
    {
        return smartEquipmentStateMapper.selectSmartEquipmentStateList(smartEquipmentState);
    }

    /**
     * 新增设备状态
     * 
     * @param smartEquipmentState 设备状态
     * @return 结果
     */
    @Override
    public int insertSmartEquipmentState(SmartEquipmentState smartEquipmentState)
    {
        smartEquipmentState.setCreateTime(DateUtils.getNowDate());
        return smartEquipmentStateMapper.insertSmartEquipmentState(smartEquipmentState);
    }

    /**
     * 修改设备状态
     * 
     * @param smartEquipmentState 设备状态
     * @return 结果
     */
    @Override
    public int updateSmartEquipmentState(SmartEquipmentState smartEquipmentState)
    {
        return smartEquipmentStateMapper.updateSmartEquipmentState(smartEquipmentState);
    }

    /**
     * 批量删除设备状态
     * 
     * @param ids 需要删除的设备状态主键
     * @return 结果
     */
    @Override
    public int deleteSmartEquipmentStateByIds(Long[] ids)
    {
        return smartEquipmentStateMapper.deleteSmartEquipmentStateByIds(ids);
    }

    /**
     * 删除设备状态信息
     * 
     * @param id 设备状态主键
     * @return 结果
     */
    @Override
    public int deleteSmartEquipmentStateById(Long id)
    {
        return smartEquipmentStateMapper.deleteSmartEquipmentStateById(id);
    }
}
